<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model app\models\VisitMedicine */
/* @var $form yii\widgets\ActiveForm */
$this->registerJsFile('@web/js/visit.js', ['depends' => 'app\assets\AppAsset']);
?>

<div class="visit-medicine-form myForm">

    <div class="alert alert-danger" id="error-msg"></div>

    <?php $form = ActiveForm::begin([
        'method' => 'post',
        'action' => $model->isNewRecord ? '/clinical/visit/create' : 'update?id='.$model->pk_id,
        'id' => 'visitForm'
    ]); ?>

    <?= $form->field($model, 'ft_md_time')->textInput(['class'=>'form-control laydate-icon date'])->error(false) ?>

    <?= $form->field($model, 'md_name')->textInput(['maxlength' => true])->error(false) ?>

    <?= $form->field($model, 'md_amount')->textInput()->error(false) ?>

    <?= $form->field($model, 'md_times')->textInput()->error(false) ?><br />

    <?= $form->field($model, 'md_usage')->textArea(['maxlength' => true])->error(false) ?><br />

    <?= $form->field($model, 'md_side_effect')->textArea(['maxlength' => true])->error(false) ?><br />

    <hr>

    <?= $form->field($info, 'pt_history')->textArea(['maxlength' => true])->error(false) ?>

    <?= $form->field($info, 'pt_body')->textArea()->error(false) ?>

    <?= $form->field($info, 'pt_solution')->textArea()->error(false) ?>

    <?= $form->field($info, 'visit_memo')->textArea()->error(false) ?><br /><br />

    <input type="hidden" id="status" value="<?= $model->isNewRecord ? 'create' : 'update?id='.$model->pk_id ?>">
    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '保存' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary', 'id' => 'submitButton']) ?>

        <?= Html::a('取消', ['/clinical/visit'], ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
